package com.lzhsite.technology.designPattern.decorate.PrizeDemo;

public class ClientForPrizeDemo
{
    public static void main(String[] args)
    {
    	
    	
        Component component = new ConcreteComponent();
        /**
         * 各个修饰器之间没有先后顺序
         */
        Decorator monthPrizeDecorator = new MonthPrizeDecorator(component);
        Decorator sumPrizeDecorator = new SumPrizeDecorator(monthPrizeDecorator);

        double zhang = sumPrizeDecorator.calculatePrize("张A", null, null);
        System.out.println("===== 张A应得奖金：" + zhang);

        double li = sumPrizeDecorator.calculatePrize("李B", null, null);
        System.out.println("===== 李B应得奖金：" + li);

        Decorator groupPrizeDecorator = new GroupPrizeDecorator(sumPrizeDecorator);
        double wang = groupPrizeDecorator.calculatePrize("王C", null, null);
        System.out.println("===== 王C应得奖金：" + wang);
    }
}
